<?php
function navPage($s_name) {
	$depth = count(explode('/', $_SERVER['PHP_SELF'])) - 3;

	for($s = ''; $depth > 0; $depth--) {
		$s .= '../';
	};

	echo $s . 'page.php?p='.urlencode($s_name);
}

?>

<div class="navMenu" id="mnuServDiv">
	<span class="navMenuTitle" id="mnuServ">Services</span>
	<ul class="navMenuBody" id="mnuServ">
		<li><a href="<?php navPage('web'); ?>">Web Design</a></li>
		<li><a href="<?php navPage('graphics'); ?>">Graphic Design</a></li>
		<li><a href="<?php navPage('cms'); ?>">Content Management</a></li>
	</ul>
</div>
<div class="navMenu"  id="mnuAboutUsDiv">
	<span class="navMenuTitle" id="mnuAboutUs">About</span>
	<ul class="navMenuBody" id="mnuAboutUs">
		<li><a href="<?php navPage('mission'); ?>">Our Mission</a></li>
		<li><a href="<?php navPage('methods'); ?>">Our Methods</a></li>
		<li><a href="<?php navPage('theteam'); ?>">Our Team</a></li>
	</ul>
</div>
<div class="navMenu" id="mnuPortfolioDiv">
	<span class="navMenuTitle" id="mnuPortfolio">Portfolio</span>
	<ul class="navMenuBody" id="mnuPortfolio">
		<li><a href="portfolio/web.html">Web</a></li>
		<li><a href="portfolio/graphics.html">Graphics</a></li>
		<li><a href="portfolio/brands.html">Brands</a></li>
	</ul>
</div>
<div class="navMenu" id="mnuResourcesDiv">
	<span class="navMenuTitle" id="mnuResources">Resources</span>
	<ul class="navMenuBody" id="mnuResources">
		<li><a href="tpl/">Templates</a></li>
		<li><a href="<?php navPage('libs'); ?>">Libraries</a></li>
	</ul>
</div>
